package com.zfei.serviceA.ribbon;



import com.netflix.client.config.CommonClientConfigKey;
import com.netflix.client.config.DefaultClientConfigImpl;
import com.netflix.client.config.IClientConfig;
import com.netflix.loadbalancer.*;
import org.springframework.beans.factory.annotation.Autowired;

import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;

import org.springframework.cloud.client.loadbalancer.LoadBalancerClient;

import org.springframework.cloud.netflix.ribbon.*;
import org.springframework.context.annotation.Bean;

import org.springframework.context.annotation.Configuration;



@Configuration
public class SelfRibbonAutoConfiguration {


    @Autowired
    private SpringClientFactory springClientFactory;



    @Bean
    @ConditionalOnMissingBean(LoadBalancerClient.class)
    public LoadBalancerClient loadBalancerClient() {
        return new SelfRibbonLoadBalancerClient(springClientFactory);
    }










}

